package com.project.controller;


import com.project.bean.LinkBean;
import com.project.bean.StudentBean;
import com.project.service.ILinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.security.Provider;
import java.util.List;

@Controller
@RequestMapping("test")
public class TestController {


    @RequestMapping("show")
    public String show(HttpServletRequest request){
        //在request中绑定共享对象，在作用范围为1次请求范围内
        request.setAttribute("name","tom");
        request.setAttribute("student",new StudentBean(10,"张飞",56));
        List<StudentBean>list=List.of(new StudentBean(1,"张一",80),
                new StudentBean(13,"王八",70),
                new StudentBean(18,"陈皮",90),
                new StudentBean(9,"刘柳",79));
        request.setAttribute("list",list);
        return "/html/index.html";
//        return "redirect:/http//www.baidu.com";
    }


}
